//
//  WBUMSDKHelper.m
//  Pods-WBUMSDKHelper_Example
//
//  Created by Mr_Lucky on 2018/9/10.
//

#import "WBUMSDKHelper.h"
/*  < 公共组件是所有友盟产品的基础组件，必选 > */
#import <UMCommon/UMCommon.h>
/*  < 统计组件 > */
#import <UMAnalytics/MobClick.h>   

@implementation WBUMSDKHelper

+ (void)startUMWithConfigure:(WBUMSDKConfigure *)configure {
    NSAssert(configure != nil, @"请设置UM配置文件");
    [UMConfigure initWithAppkey:configure.appkey
                        channel:configure.channel];
    [MobClick setScenarioType:configure.scenarioType];
    [MobClick setCrashReportEnabled:configure.crashReportEnabled];
    [UMConfigure setLogEnabled:configure.logEnabled];
}

+ (void)wb_trackEvent:(NSString *)event_id {
    [MobClick event:event_id];
}

+ (void)wb_trackEvent:(NSString *)event_id
                label:(NSString *)label {
    [MobClick event:event_id
              label:label];
}

+ (void)wb_trackEvent:(NSString *)event_id
            attribute:(NSDictionary *)attribute {
    [MobClick event:event_id
         attributes:attribute];
}

+ (void)wb_beginLogPageView:(NSString *)pageName {
    [MobClick beginLogPageView:pageName];
}

+ (void)wb_endLogPageView:(NSString *)pageName {
    [MobClick endLogPageView:pageName];
}

@end
